home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.event.ActionEvent;
- import javax.swing.AbstractAction;
- import javax.swing.tree.TreePath;
-
- public class BasicTreeUI$TreeHomeAction extends AbstractAction {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- protected int direction;
- private boolean addToSelection;
- private boolean changeSelection;
-
- public BasicTreeUI$TreeHomeAction(BasicTreeUI var1, int var2, String var3) {
- this(var1, var2, var3, false, true);
- }
-
- private BasicTreeUI$TreeHomeAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
- this.this$0 = var1;
- this.direction = var2;
- this.changeSelection = var5;
- this.addToSelection = var4;
- }
-
- // $FF: synthetic method
- BasicTreeUI$TreeHomeAction(BasicTreeUI var1, BasicTreeUI.1 var2, int var3, String var4, boolean var5, boolean var6) {
- this(var1, var3, var4, var5, var6);
- }
-
- public void actionPerformed(ActionEvent var1) {
- int var2 = this.this$0.getRowCount(this.this$0.tree);
- if (this.this$0.tree != null && var2 > 0) {
- if (this.direction == -1) {
- this.this$0.ensureRowsAreVisible(0, 0);
- if (this.addToSelection) {
- TreePath var3 = BasicTreeUI.access$9(this.this$0);
- int var4 = var3 == null ? -1 : this.this$0.getRowForPath(this.this$0.tree, var3);
- if (var4 == -1) {
- this.this$0.tree.setSelectionInterval(0, 0);
- } else {
- this.this$0.tree.setSelectionInterval(0, var4);
- BasicTreeUI.access$2(this.this$0, var3);
- BasicTreeUI.access$3(this.this$0, this.this$0.getPathForRow(this.this$0.tree, 0));
- }
- } else if (this.changeSelection) {
- this.this$0.tree.setSelectionInterval(0, 0);
- } else {
- BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, 0), true);
- }
- } else {
- this.this$0.ensureRowsAreVisible(var2 - 1, var2 - 1);
- if (this.addToSelection) {
- TreePath var5 = BasicTreeUI.access$9(this.this$0);
- int var6 = var5 == null ? -1 : this.this$0.getRowForPath(this.this$0.tree, var5);
- if (var6 == -1) {
- this.this$0.tree.setSelectionInterval(var2 - 1, var2 - 1);
- } else {
- this.this$0.tree.setSelectionInterval(var6, var2 - 1);
- BasicTreeUI.access$2(this.this$0, var5);
- BasicTreeUI.access$3(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var2 - 1));
- }
- } else if (this.changeSelection) {
- this.this$0.tree.setSelectionInterval(var2 - 1, var2 - 1);
- } else {
- BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var2 - 1), true);
- }
- }
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-